#include <stdio.h>

void reverse(int *p, int n) {
    int *pj, t;
    for (pj = p + n - 1; p < pj; p++, pj--) {
        t = *p;
        *p = *pj;
        *pj = t;
    }
}

int main(void) {
    int i, a[10], n;
    printf("Enter number of elements: ");
    scanf("%d", &n);
    for (i = 0; i < n; i++)
        scanf("%d", &a[i]);
    reverse(a, n);
    printf("Reversed array is:\n");
    for (i = 0; i < n; i++)
        printf("%d\t", a[i]);
    return 0;
}
